<template>
  <div class="admin-attractions">
    <el-page-header @back="goBack">
      <template #content>
        <span class="text-large font-600 mr-3">景点管理</span>
      </template>
    </el-page-header>

    <!-- 操作栏 -->
    <el-card class="action-bar" style="margin-top: 20px;">
      <el-row :gutter="20" align="middle">
        <el-col :span="12">
          <el-input
            v-model="searchKeyword"
            placeholder="搜索景点名称、地址..."
            style="width: 100%; max-width: 500px;"
            clearable
            @input="handleSearch"
          >
            <template #prefix>
              <el-icon><Search /></el-icon>
            </template>
          </el-input>
        </el-col>
        <el-col :span="12" style="text-align: right;">
          <el-button type="primary" :icon="Plus" @click="showAddDialog = true">
            添加景点
          </el-button>
          <el-button type="success" :icon="Download" @click="showSyncDialog = true">
            批量导入
          </el-button>
          <el-button type="info" :icon="Refresh" @click="fetchAttractions">
            刷新
          </el-button>
        </el-col>
      </el-row>
    </el-card>

    <!-- 景点表格 -->
    <el-card style="margin-top: 20px;">
      <el-table
        :data="attractions"
        v-loading="loading"
        stripe
        style="width: 100%"
      >
        <el-table-column label="图片" width="100">
          <template #default="scope">
            <el-image
              v-if="scope.row.primary_image"
              :src="getImageUrl(scope.row.primary_image)"
              fit="cover"
              style="width: 80px; height: 80px; border-radius: 4px;"
              lazy
            />
            <div v-else style="width: 80px; height: 80px; background: #f5f5f5; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #999; font-size: 12px;">
              暂无图片
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="景点名称" width="200" />
        <el-table-column prop="address" label="地址" min-width="200" />
        <el-table-column prop="category_display" label="分类" width="120" />
        <el-table-column prop="ticket_price" label="门票价格" width="120">
          <template #default="scope">
            ¥{{ scope.row.ticket_price }}
          </template>
        </el-table-column>
        <el-table-column prop="rating" label="评分" width="100">
          <template #default="scope">
            <el-rate :model-value="scope.row.rating / 1" disabled size="small" />
          </template>
        </el-table-column>
        <el-table-column label="操作" width="300" fixed="right">
          <template #default="scope">
            <el-button type="primary" size="small" @click="editAttraction(scope.row)">
              编辑
            </el-button>
            <el-button type="success" size="small" @click="viewDetail(scope.row)">
              详情
            </el-button>
            <el-button type="warning" size="small" @click="manageImages(scope.row)">
              图片管理
            </el-button>
            <el-button type="danger" size="small" @click="deleteAttraction(scope.row)">
              删除
            </el-button>
          </template>
        </el-table-column>
      </el-table>

      <!-- 分页 -->
      <el-pagination
        v-if="total > pageSize"
        v-model:current-page="currentPage"
        v-model:page-size="pageSize"
        :total="total"
        :page-sizes="[12, 24, 48, 96]"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        style="margin-top: 20px; justify-content: center;"
      />
    </el-card>

    <!-- 添加/编辑景点对话框 -->
    <el-dialog
      v-model="showAddDialog"
      :title="editingAttraction ? '编辑景点' : '添加景点'"
      width="600px"
    >
      <el-form :model="addForm" label-width="100px">
        <el-form-item label="景点名称" required>
          <el-input v-model="addForm.name" placeholder="请输入景点名称" />
        </el-form-item>
        <el-form-item label="地址">
          <el-input v-model="addForm.address" placeholder="请输入地址" />
        </el-form-item>
        <el-form-item label="描述">
          <el-input
            v-model="addForm.description"
            type="textarea"
            :rows="4"
            placeholder="请输入景点描述"
          />
        </el-form-item>
        <el-form-item label="分类">
          <el-select v-model="addForm.category" placeholder="请选择分类">
            <el-option label="文化古迹" value="cultural" />
            <el-option label="自然风光" value="natural" />
            <el-option label="现代建筑" value="modern" />
            <el-option label="美食购物" value="food" />
          </el-select>
        </el-form-item>
        <el-form-item label="门票价格">
          <el-input-number v-model="addForm.ticket_price" :min="0" :precision="2" />
        </el-form-item>
        <el-form-item label="开放时间">
          <el-time-picker
            v-model="addForm.open_time"
            placeholder="选择开放时间"
            format="HH:mm"
            value-format="HH:mm"
            style="width: 100%"
          />
        </el-form-item>
        <el-form-item label="关闭时间">
          <el-time-picker
            v-model="addForm.close_time"
            placeholder="选择关闭时间"
            format="HH:mm"
            value-format="HH:mm"
            style="width: 100%"
          />
        </el-form-item>
        <el-form-item label="建议游览时间（分钟）">
          <el-input-number v-model="addForm.visit_time" :min="0" :max="480" :step="15" />
        </el-form-item>
        <el-form-item label="经度">
          <el-input-number v-model="addForm.longitude" :precision="6" />
        </el-form-item>
        <el-form-item label="纬度">
          <el-input-number v-model="addForm.latitude" :precision="6" />
        </el-form-item>
      </el-form>
      <template #footer>
        <el-button @click="showAddDialog = false">取消</el-button>
        <el-button type="primary" @click="handleSaveAttraction" :loading="adding">
          确定
        </el-button>
      </template>
    </el-dialog>

    <!-- 批量导入对话框 -->
    <el-dialog
      v-model="showSyncDialog"
      title="批量导入景点"
      width="600px"
    >
      <el-alert
        type="info"
        :closable="false"
        show-icon
        style="margin-bottom: 20px;"
      >
        <template #default>
          <div>
            <p>从高德地图API批量导入景点数据</p>
            <p style="margin-top: 10px; font-size: 12px;">
              提示：此操作需要配置高德地图API Key，并在后端执行同步命令
            </p>
          </div>
        </template>
      </el-alert>
      <el-form label-width="120px">
        <el-form-item label="搜索关键词">
          <el-input
            v-model="syncForm.keywords"
            placeholder="例如：滕王阁,八一起义纪念馆"
          />
        </el-form-item>
        <el-form-item label="最大数量">
          <el-input-number v-model="syncForm.max_count" :min="1" :max="100" />
        </el-form-item>
        <el-form-item label="更新已存在">
          <el-switch v-model="syncForm.update_existing" />
        </el-form-item>
        <el-form-item label="跳过图片">
          <el-switch v-model="syncForm.skip_images" />
        </el-form-item>
      </el-form>
      <template #footer>
        <el-button @click="showSyncDialog = false">取消</el-button>
        <el-button type="primary" @click="handleSyncAttractions" :loading="syncing">
          开始导入
        </el-button>
      </template>
    </el-dialog>

    <!-- 详情对话框 -->
    <el-dialog
      v-model="detailDialogVisible"
      :title="currentAttraction?.name"
      width="800px"
    >
      <div v-if="currentAttraction">
        <el-descriptions :column="1" border>
          <el-descriptions-item label="景点名称">
            {{ currentAttraction.name }}
          </el-descriptions-item>
          <el-descriptions-item label="地址">
            {{ currentAttraction.address || '暂无地址' }}
          </el-descriptions-item>
          <el-descriptions-item label="景点描述">
            {{ currentAttraction.description || '暂无描述' }}
          </el-descriptions-item>
          <el-descriptions-item label="门票价格">
            ¥{{ currentAttraction.ticket_price }}
          </el-descriptions-item>
        </el-descriptions>
        
        <!-- 景点图片管理 -->
        <el-divider>景点图片管理</el-divider>
        <div v-loading="imagesLoading">
          <ImageUpload
            v-if="currentAttraction.id"
            upload-type="attraction"
            :related-id="currentAttraction.id"
            :limit="9"
            :multiple="true"
            v-model="attractionImages"
            @success="handleImageSuccess"
          />
        </div>
      </div>
    </el-dialog>

    <!-- 图片管理对话框 -->
    <el-dialog
      v-model="showImageDialog"
      :title="`${currentAttraction?.name} - 图片管理`"
      width="900px"
      @close="resetImageDialog"
    >
      <div v-if="currentAttraction">
        <div style="margin-bottom: 20px;">
          <el-button type="primary" :icon="Plus" @click="showUploadImageDialog = true">
            上传图片
          </el-button>
          <el-button type="info" :icon="Refresh" @click="fetchAttractionImages">
            刷新
          </el-button>
        </div>

        <div v-loading="imagesLoading">
          <div v-if="attractionImages.length > 0" class="images-grid">
            <div
              v-for="img in attractionImages"
              :key="img.id"
              class="image-item"
              :class="{ 'is-primary': img.is_primary }"
            >
              <el-image
                :src="getImageUrl(img.image)"
                fit="cover"
                class="image-preview"
                :preview-src-list="attractionImages.map(i => getImageUrl(i.image))"
                :initial-index="attractionImages.findIndex(i => i.id === img.id)"
              />
              <div class="image-overlay">
                <div class="image-actions">
                  <el-button
                    v-if="!img.is_primary"
                    type="primary"
                    size="small"
                    @click="setPrimaryImage(img.id)"
                    :loading="settingPrimary === img.id"
                  >
                    设为主图
                  </el-button>
                  <el-tag v-else type="warning" size="small">主图</el-tag>
                  <el-button
                    type="danger"
                    size="small"
                    @click="deleteImage(img.id)"
                    :loading="deletingImage === img.id"
                  >
                    删除
                  </el-button>
                </div>
              </div>
            </div>
          </div>
          <el-empty v-else description="暂无图片" />
        </div>
      </div>
    </el-dialog>

    <!-- 上传图片对话框 -->
    <el-dialog
      v-model="showUploadImageDialog"
      title="上传图片"
      width="500px"
      @close="resetUploadForm"
    >
      <el-form :model="uploadForm" label-width="100px">
        <el-form-item label="选择图片">
          <el-upload
            ref="uploadRef"
            :action="uploadAction"
            :headers="uploadHeaders"
            :data="uploadData"
            :name="'image'"
            :file-list="uploadFileList"
            :on-success="handleUploadSuccess"
            :on-error="handleUploadError"
            :on-remove="handleUploadRemove"
            :before-upload="beforeUpload"
            :limit="5"
            :multiple="true"
            list-type="picture-card"
            :class="{ 'hide-upload': uploadFileList.length >= 5 }"
            :disabled="uploading"
          >
            <el-icon><Plus /></el-icon>
            <template #tip>
              <div class="el-upload__tip">
                支持 JPG、PNG、GIF 格式，单张图片不超过5MB，最多5张
              </div>
            </template>
          </el-upload>
        </el-form-item>
        <el-form-item label="设为封面">
          <el-switch v-model="uploadForm.is_primary" />
        </el-form-item>
      </el-form>
      <template #footer>
        <el-button @click="showUploadImageDialog = false">取消</el-button>
        <el-button type="primary" @click="submitUpload" :loading="uploading">
          上传
        </el-button>
      </template>
    </el-dialog>
  </div>
</template>

<script>
import { ref, onMounted, computed } from 'vue'
import { useRouter } from 'vue-router'
import { useStore } from 'vuex'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
  Search,
  Plus,
  Download,
  Refresh
} from '@element-plus/icons-vue'
import TravelAPI from '../api/travel'
import ImageUpload from '../components/ImageUpload.vue'
import logger from '../utils/logger'
import { getApiBaseUrl } from '../utils/apiConfig'
import axios from 'axios'

export default {
  name: 'AdminAttractions',
  components: {
    Search,
    ImageUpload
  },
  setup() {
    const router = useRouter()
    const store = useStore()
    const loading = ref(false)
    const imagesLoading = ref(false)
    const adding = ref(false)
    const syncing = ref(false)
    const attractions = ref([])
    const searchKeyword = ref('')
    const currentPage = ref(1)
    const pageSize = ref(20)
    const total = ref(0)
    const detailDialogVisible = ref(false)
    const showAddDialog = ref(false)
    const showSyncDialog = ref(false)
    const showImageDialog = ref(false)
    const showUploadImageDialog = ref(false)
    const currentAttraction = ref(null)
    const editingAttraction = ref(null)
    const attractionImages = ref([])
    const uploading = ref(false)
    const uploadRef = ref(null)
    const uploadFileList = ref([])
    const settingPrimary = ref(null)
    const deletingImage = ref(null)
    const uploadForm = ref({
      is_primary: false
    })

    const isAdmin = computed(() => store.getters.isAdmin)

    const addForm = ref({
      name: '',
      address: '',
      description: '',
      category: 'cultural',
      ticket_price: 0,
      open_time: null,
      close_time: null,
      visit_time: null,
      longitude: 115.89,
      latitude: 28.68
    })

    const syncForm = ref({
      keywords: '',
      max_count: 50,
      update_existing: false,
      skip_images: false
    })

    const fetchAttractions = async () => {
      loading.value = true
      try {
        const params = {
          page: currentPage.value,
          page_size: pageSize.value
        }

        if (searchKeyword.value) {
          params.keyword = searchKeyword.value
        }

        const data = await TravelAPI.getAttractions(params)
        
        if (Array.isArray(data)) {
          attractions.value = data
          total.value = data.length
        } else {
          attractions.value = data.results || []
          total.value = data.count || 0
        }
      } catch (error) {
        logger.error('获取景点列表失败:', error)
        ElMessage.error('获取景点列表失败')
      } finally {
        loading.value = false
      }
    }

    const handleSearch = () => {
      currentPage.value = 1
      fetchAttractions()
    }

    const handleSizeChange = () => {
      fetchAttractions()
    }

    const handleCurrentChange = () => {
      fetchAttractions()
    }

    const getImageUrl = (url) => {
      if (!url) return ''
      // 如果已经是完整URL，直接返回
      if (url.startsWith('http://') || url.startsWith('https://')) {
        return url
      }
      // 如果是相对路径，添加base URL
      if (url.startsWith('/media/') || url.startsWith('/static/')) {
        const baseUrl = getApiBaseUrl()
        return `${baseUrl}${url}`
      }
      // 如果只是文件名，尝试构建完整路径
      if (!url.startsWith('/')) {
        const baseUrl = getApiBaseUrl()
        return `${baseUrl}/media/${url}`
      }
      return url
    }

    const viewDetail = (attraction) => {
      currentAttraction.value = attraction
      detailDialogVisible.value = true
      if (attraction.id) {
        fetchAttractionImages(attraction.id)
      }
    }

    const fetchAttractionImages = async (attractionId) => {
      if (!attractionId) return
      imagesLoading.value = true
      try {
        const response = await TravelAPI.getAttractionImages(attractionId)
        attractionImages.value = (response || []).map(img => ({
          id: img.id,
          image: img.image,
          is_primary: img.is_primary || false,
          url: getImageUrl(img.image),
          name: `image_${img.id}.jpg`
        }))
      } catch (error) {
        logger.error('获取景点图片失败:', error)
        attractionImages.value = []
      } finally {
        imagesLoading.value = false
      }
    }

    // 打开图片管理对话框
    const manageImages = async (attraction) => {
      currentAttraction.value = attraction
      showImageDialog.value = true
      if (attraction.id) {
        await fetchAttractionImages(attraction.id)
      }
    }

    // 设置主图
    const setPrimaryImage = async (imageId) => {
      if (!currentAttraction.value?.id) return
      
      settingPrimary.value = imageId
      try {
        const baseUrl = getApiBaseUrl()
        const token = store.state.token || localStorage.getItem('token')
        
        await axios.patch(
          `${baseUrl}/api/attractions/${currentAttraction.value.id}/set_primary_image/`,
          { image_id: imageId },
          {
            headers: {
              'Authorization': token ? `Token ${token}` : '',
              'Content-Type': 'application/json'
            }
          }
        )
        
        ElMessage.success('已设置为主图')
        await fetchAttractionImages(currentAttraction.value.id)
      } catch (error) {
        logger.error('设置主图失败:', error)
        const errorMsg = error.response?.data?.error || '设置主图失败'
        ElMessage.error(errorMsg)
      } finally {
        settingPrimary.value = null
      }
    }

    // 删除图片
    const deleteImage = async (imageId) => {
      if (!currentAttraction.value?.id) return
      
      try {
        await ElMessageBox.confirm(
          '确定要删除这张图片吗？',
          '确认删除',
          {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }
        )

        deletingImage.value = imageId
        const baseUrl = getApiBaseUrl()
        const token = store.state.token || localStorage.getItem('token')
        
        await axios.delete(
          `${baseUrl}/api/attractions/${currentAttraction.value.id}/delete_image/?image_id=${imageId}`,
          {
            headers: {
              'Authorization': token ? `Token ${token}` : ''
            }
          }
        )
        
        ElMessage.success('删除成功')
        await fetchAttractionImages(currentAttraction.value.id)
      } catch (error) {
        if (error !== 'cancel') {
          logger.error('删除图片失败:', error)
          ElMessage.error('删除图片失败')
        }
      } finally {
        deletingImage.value = null
      }
    }

    // 重置图片对话框
    const resetImageDialog = () => {
      attractionImages.value = []
      currentAttraction.value = null
    }

    const handleImageSuccess = () => {
      if (currentAttraction.value?.id) {
        fetchAttractionImages(currentAttraction.value.id)
      }
    }

    // 上传配置
    const uploadAction = computed(() => {
      if (!currentAttraction.value?.id) return ''
      const baseUrl = process.env.VUE_APP_API_BASE_URL || 'http://localhost:8000'
      return `${baseUrl}/api/attractions/${currentAttraction.value.id}/upload_image/`
    })
    
    const uploadHeaders = computed(() => {
      const token = store.state.token || localStorage.getItem('token')
      return {
        'Authorization': token ? `Token ${token}` : ''
      }
    })
    
    const uploadData = computed(() => {
      return {
        is_primary: uploadForm.value.is_primary
      }
    })

    // 上传前验证
    const beforeUpload = (file) => {
      const isImage = file.type.startsWith('image/')
      const isLt5M = file.size / 1024 / 1024 < 5

      if (!isImage) {
        ElMessage.error('只能上传图片文件！')
        return false
      }
      if (!isLt5M) {
        ElMessage.error('图片大小不能超过5MB！')
        return false
      }
      return true
    }

    // 上传成功
    const handleUploadSuccess = () => {
      ElMessage.success('图片上传成功！')
      if (currentAttraction.value?.id) {
        fetchAttractionImages(currentAttraction.value.id)
      }
      resetUploadForm()
      showUploadImageDialog.value = false
    }

    // 上传失败
    const handleUploadError = (error) => {
      ElMessage.error('图片上传失败，请重试')
      logger.error('图片上传失败:', error)
    }

    // 移除文件
    const handleUploadRemove = (file) => {
      const index = uploadFileList.value.findIndex(item => item.uid === file.uid)
      if (index > -1) {
        uploadFileList.value.splice(index, 1)
      }
    }

    // 提交上传
    const submitUpload = () => {
      if (uploadFileList.value.length === 0) {
        ElMessage.warning('请至少选择一张图片')
        return
      }
      // el-upload会自动上传
      ElMessage.info('图片正在上传中...')
    }

    // 重置上传表单
    const resetUploadForm = () => {
      uploadFileList.value = []
      uploadForm.value.is_primary = false
      if (uploadRef.value) {
        uploadRef.value.clearFiles()
      }
    }

    const editAttraction = (attraction) => {
      editingAttraction.value = attraction
      addForm.value = {
        name: attraction.name,
        address: attraction.address || '',
        description: attraction.description || '',
        category: attraction.category || 'cultural',
        ticket_price: attraction.ticket_price || 0,
        open_time: attraction.open_time || null,
        close_time: attraction.close_time || null,
        visit_time: attraction.visit_time || null,
        longitude: parseFloat(attraction.longitude) || 115.89,
        latitude: parseFloat(attraction.latitude) || 28.68
      }
      showAddDialog.value = true
    }

    const handleSaveAttraction = async () => {
      if (!addForm.value.name) {
        ElMessage.warning('请输入景点名称')
        return
      }

      adding.value = true
      try {
        if (editingAttraction.value) {
          // 更新景点
          await TravelAPI.updateAttraction(editingAttraction.value.id, addForm.value)
          ElMessage.success('更新成功')
        } else {
          // 创建景点
          await TravelAPI.createAttraction(addForm.value)
          ElMessage.success('添加成功')
        }
        showAddDialog.value = false
        resetAddForm()
        fetchAttractions()
      } catch (error) {
        logger.error('保存景点失败:', error)
        ElMessage.error(error.response?.data?.error || '保存失败')
      } finally {
        adding.value = false
      }
    }

    const resetAddForm = () => {
      addForm.value = {
        name: '',
        address: '',
        description: '',
        category: 'cultural',
        ticket_price: 0,
        open_time: null,
        close_time: null,
        visit_time: null,
        longitude: 115.89,
        latitude: 28.68
      }
      editingAttraction.value = null
    }

    const deleteAttraction = async (attraction) => {
      try {
        await ElMessageBox.confirm(
          `确定要删除景点"${attraction.name}"吗？此操作不可恢复！`,
          '确认删除',
          {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }
        )
        
        await TravelAPI.deleteAttraction(attraction.id)
        ElMessage.success('删除成功')
        fetchAttractions()
      } catch (error) {
        if (error !== 'cancel') {
          logger.error('删除景点失败:', error)
          ElMessage.error(error.response?.data?.error || '删除失败')
        }
      }
    }

    const handleSyncAttractions = () => {
      ElMessage.info('批量导入功能需要在后端执行命令：python manage.py sync_attractions_from_amap')
      showSyncDialog.value = false
    }

    const goBack = () => {
      router.push('/admin')
    }

    onMounted(() => {
      if (!isAdmin.value) {
        ElMessage.error('您没有管理员权限')
        router.push('/')
        return
      }
      fetchAttractions()
    })

    return {
      loading,
      imagesLoading,
      adding,
      syncing,
      attractions,
      searchKeyword,
      currentPage,
      pageSize,
      total,
      detailDialogVisible,
      showAddDialog,
      showSyncDialog,
      currentAttraction,
      editingAttraction,
      attractionImages,
      addForm,
      syncForm,
      isAdmin,
      handleSearch,
      handleSizeChange,
      handleCurrentChange,
      viewDetail,
      editAttraction,
      deleteAttraction,
      handleSaveAttraction,
      handleSyncAttractions,
      handleImageSuccess,
      manageImages,
      setPrimaryImage,
      deleteImage,
      resetImageDialog,
      showImageDialog,
      showUploadImageDialog,
      uploading,
      uploadRef,
      uploadFileList,
      uploadForm,
      settingPrimary,
      deletingImage,
      uploadAction,
      uploadHeaders,
      uploadData,
      beforeUpload,
      handleUploadSuccess,
      handleUploadError,
      handleUploadRemove,
      submitUpload,
      resetUploadForm,
      getImageUrl,
      goBack,
      // 图标组件（用于:icon属性）
      Plus,
      Download,
      Refresh
    }
  }
}
</script>

<style scoped>
.admin-attractions {
  /* 南昌旅游特色：天空蓝渐变背景 */
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 50%, #90CAF9 100%);
  min-height: 100vh;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.action-bar {
  margin-bottom: 20px;
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.image-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #ebeef5;
  transition: all 0.3s ease;
}

.image-item.is-primary {
  border-color: #D4AF37;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.image-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-preview {
  width: 100%;
  height: 200px;
  display: block;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  padding: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-item:hover .image-overlay {
  opacity: 1;
}

.image-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.hide-upload :deep(.el-upload--picture-card) {
  display: none;
}
</style>

